package com.example.lx5_22.user

import androidx.lifecycle.MutableLiveData
import com.example.base.entity.LoginEntity
import com.example.base.mvvm.BaseViewModel
import com.example.base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class UserViewModel @Inject constructor(val apiService: ApiService) : BaseViewModel() {
    val loginData = MutableLiveData<LoginEntity>()

    fun login(username:String,password:String){
        httpRequest({apiService.login(username,password)},loginData::postValue)
    }
}